#ifndef MAP_H
#define MAP_H
class Map
{
	private:
	int c[25][2];/// the position of each stone;
	int a[6][6];/// the number of each position's stone;
	int t[3];/// totals of each player's stones;
	double val[3];
	int ran[12];
	public:
		bool move(int si,int sj,int ei,int ej);
		void umove(int si,int sj,int ei,int ej,bool e);
		void eat(int si,int sj,int di,int dj,int &ei,int &ej);
		Map();
		Map(const Map& b);
		int get(int i,int j);
		int gett(int i);
		double getVal(int i);
		Map &operator=(const Map &b);
		bool getc(int k,bool b,int &i,int &j);
		bool getRandC(int k,bool b,int &i,int &j);
};
struct Steps
{
	int d;
	int si() const
	{return d&(7);
	}
	int sj() const
	{return (d>>3)&7;
	}
	int ei() const
	{return (d>>6)&7;
	}
	int ej() const
	{return (d>>9)&7;
	}

	bool e() const
	{return (d>>12)&1;
	}
	Steps(int si,int sj,int ei,int ej,bool b=0)
	{	si&=7;sj&=7;ei&=7;ej&=7;b&=1;
		d=si|(sj<<3)|(ei<<6)|(ej<<9)|(b<<12);
	}
	Steps(){}
};
#endif
